package com.ycsj.goldmedalnewconcept.common;

import android.content.Context;
import android.support.multidex.MultiDex;

import com.blankj.utilcode.util.Utils;
import com.iflytek.cloud.SpeechUtility;
import com.mob.MobSDK;
import com.ycsj.common.base.BaseApplication;
import com.ycsj.common.base.SpKeys;
import com.ycsj.common.utils.SPUtil;

import cn.jpush.android.api.JPushInterface;

//import com.jdy.haoduoaiteacher.MyTeacherApp;

/**
 * 项目自身的Application类,用于一些初始化的全局配置
 * MyTeacherApp
 */

public class MyApplication extends BaseApplication {
    @Override
    public void onCreate() {
        super.onCreate();

//     //初始化科大讯飞SDK
        SpeechUtility.createUtility(this, "appid=" + SpKeys.KDXF);

        //初始化ShareSdk
        MobSDK.init(this);
        MobSDK.submitPolicyGrantResult(true);

        //初始化极光推送
        JPushInterface.init(this);

        //关闭 CrashLog 上报
        JPushInterface.stopCrashHandler(this);

        //设置极光的推送别名
        String registrationID = JPushInterface.getRegistrationID(this);

        //Sp中保存registrationID
        SPUtil.put(this, SpKeys.JPUSH_ID, registrationID);

        //初始化工具类
        Utils.init(this);

        //吐司初始化
//        SmartShow.init(this);

    }


    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);

        //解决65536的报错,分包处理
        MultiDex.install(this);
    }

}
